UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6kf85QBwiF+h4nI9oemhIQ8/WMcDHpTg40f4onToOGs=' 
WHERE 
  key_id = 'cc8f1bba08b1b53c0d06ea5886e63dcade21bf104dd85acd6c9fdb6b57c38263' 
  AND (
    token = '6kf85QBwiF+h4nI9oemhIQ8/WMcDHpTg40f4onToOGs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022