UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hk/+njLecJrArclUAL19GI0po5x9WwE0wdOe5oNOG8U=' 
WHERE 
  key_id = '75e8c397c1056980f752815b7b1ae6045ef3719f260f8b2717cdf45787c2a875' 
  AND (
    token = 'Hk/+njLecJrArclUAL19GI0po5x9WwE0wdOe5oNOG8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043