UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/529AriSdHCB9t6j/QySzwA/pJ0YRICnABNrMjPDsY4=' 
WHERE 
  key_id = '2bfcd61eb8cabdea794a923a1bc665c20feac45d56a34e445ab4afffcf654a80' 
  AND (
    token = '/529AriSdHCB9t6j/QySzwA/pJ0YRICnABNrMjPDsY4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00082