UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5fS3clMlXHefHk63GXrnASPHxldka2A8lk3fYnaAjjY='
WHERE
key_id = '2b311530596fc5bb4f55b795e40ef43293df07e502610b595eca413de7466806'
AND (
token = '5fS3clMlXHefHk63GXrnASPHxldka2A8lk3fYnaAjjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)