UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lko2uD+fUTKwB22gpmwOC/vgfpF5OnOV3NCkVxZK4j4=' 
WHERE 
  key_id = '0de063e06e442edbc2f6297bd41e2ead5591b2a86fdab123c5c3f5cca0b4cca3' 
  AND (
    token = 'Lko2uD+fUTKwB22gpmwOC/vgfpF5OnOV3NCkVxZK4j4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046