UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jhWo6QIF2yYGODkwiuf/PEI61Lv+nxXDYNDeNcZljsU=' 
WHERE 
  key_id = 'c05d946cb0d4ef72b73aad40ebf0d9c7bc7ef5fa51f3165d4150f37ff16a2483' 
  AND (
    token = 'jhWo6QIF2yYGODkwiuf/PEI61Lv+nxXDYNDeNcZljsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021