UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oZmMCVDwG++EJ9JOXDs8CBm5o5+R6lmlDaE52GKQtIA=' 
WHERE 
  key_id = 'a34181593147ce4aa7d8e04eca5d175b78dfba7307aca340d126e6b2e365f9f4' 
  AND (
    token = 'oZmMCVDwG++EJ9JOXDs8CBm5o5+R6lmlDaE52GKQtIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029