UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j+jODN3nFMcEMkeEhtZ6QGjXWincJx/kEDclznhEbA8=' 
WHERE 
  key_id = 'c84cbe8db174f50e99de64909a48c83ccc647c80c7fe9ff5e121ca5e9604132f' 
  AND (
    token = 'j+jODN3nFMcEMkeEhtZ6QGjXWincJx/kEDclznhEbA8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057