UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EJdi4da6AEwRVt+DfGspUT6LdH4jchgyhO4RSXn4q54=' 
WHERE 
  key_id = 'cee2819f4c15135c7478d36a821feba8ec0f4bfae04cd932c9e5c0a21e498bae' 
  AND (
    token = 'EJdi4da6AEwRVt+DfGspUT6LdH4jchgyhO4RSXn4q54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019