UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm0OV0dOTGJHBVWBZA9Kkgrjezt4U0WJsGxUHr61BG+I=' 
WHERE 
  key_id = '3d022401e3b90dbe16092691b5a8f2754ad1cfc2c1cbe9498061e9fa8c1eb282' 
  AND (
    token = 'm0OV0dOTGJHBVWBZA9Kkgrjezt4U0WJsGxUHr61BG+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026