UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KyypS1q65O8rT9LPrEXaKvmzXruAwZW/OWXsq1gPo8Q=' 
WHERE 
  key_id = '710a84d858c4ab9ff6143ae789d7415bf3f9d5c9a39b2693e6dfa8ab84595624' 
  AND (
    token = 'KyypS1q65O8rT9LPrEXaKvmzXruAwZW/OWXsq1gPo8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037