UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SFo0emjxcAhJ6uiXgrFRYuXmFr3Syngxfm7FwAxoJoQ=' 
WHERE 
  key_id = '548affadee76e8e7e508a4fe38ec54eee7cc982b8837a06793ed849ba19037cd' 
  AND (
    token = 'SFo0emjxcAhJ6uiXgrFRYuXmFr3Syngxfm7FwAxoJoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038