UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mk4jNDU0wsgCBduYUyp5DSBpINlMZHUncyMoDtCyWl0=' 
WHERE 
  key_id = 'bfdf3b204ab2ffd5e3be45b49ca2af84d14a694e1b5ca8d6fc93f2d2ff03386f' 
  AND (
    token = 'mk4jNDU0wsgCBduYUyp5DSBpINlMZHUncyMoDtCyWl0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036