UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/iCYl9mrYN+9r6tWeQb9NFvw9zrCuGP7eciNg2kjlyU='
WHERE
key_id = 'c9e57dfaea285412224d1f37e2b8cd94c5faae3c79e906fd9b4fbd88f20e58c4'
AND (
token = '/iCYl9mrYN+9r6tWeQb9NFvw9zrCuGP7eciNg2kjlyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)