UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ffU2sLbDBM5PQJWJ6LAFwYIyDj+mzUFMTeB81lTlarw=' 
WHERE 
  key_id = '69527b50b3f3ca07656d461c0ac5ddb55f3ebfc4e1503e69cf758853d27dda31' 
  AND (
    token = 'ffU2sLbDBM5PQJWJ6LAFwYIyDj+mzUFMTeB81lTlarw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029