UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FwxrphhMPd1GfIvrwx0hWFBINDkDERzkelvrtkARtzk=' 
WHERE 
  key_id = '92d1283312d7e0641c8c482802308c086c351a8e9bb184d5e0f7185dfe14a26a' 
  AND (
    token = 'FwxrphhMPd1GfIvrwx0hWFBINDkDERzkelvrtkARtzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055