UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IwICDSOpASrLJFHgoF0CDp3kovFwqWwwByImQj5+/Gw=' 
WHERE 
  key_id = 'fbd228d68a20b79229d75d24a2c720dd9e3ccad9c138bc30af45c8d1f08f3b14' 
  AND (
    token = 'IwICDSOpASrLJFHgoF0CDp3kovFwqWwwByImQj5+/Gw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016