UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YgsxrXw1l8pFBNDl6+Y64ze8tTJdqCa/cQqBx02D3wU=' 
WHERE 
  key_id = 'eaf31008a57518bdbae0a5208c12ee21ecac709c06c110c7dd70d2242e96f056' 
  AND (
    token = 'YgsxrXw1l8pFBNDl6+Y64ze8tTJdqCa/cQqBx02D3wU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081