UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMSA8FR/d2ulUfaOa80YrNrkYchicqqGYCm0K8Ga9do=' 
WHERE 
  key_id = '58b054a5b6ad3cb4d3f035cfe45c5e4b29cc2018b8e00dce344051b6a6cf3fbb' 
  AND (
    token = 'ZMSA8FR/d2ulUfaOa80YrNrkYchicqqGYCm0K8Ga9do=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030