UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AEqCL46+kE7bECdwVoZ++sWQMJFg4N5NLszt9RL/9Xg=' 
WHERE 
  key_id = 'e38e1f19ebffb65b32683f09c65a9caa79a6e69212c080d330adcddc8607f97b' 
  AND (
    token = 'AEqCL46+kE7bECdwVoZ++sWQMJFg4N5NLszt9RL/9Xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022