UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UTjkMji437F3rYaQTVgQKWWrgoINBGSrlMwD1RfxgFE=' 
WHERE 
  key_id = '7f1b67f1f0f2c09dd1bc4cd0df8a5e61ae88f9cf967deec673901f66c3fd860b' 
  AND (
    token = 'UTjkMji437F3rYaQTVgQKWWrgoINBGSrlMwD1RfxgFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029