UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IL7Z3sIF+IGm/Tgzd1CmZ6SdQGlmWnD4aFZ7XpTySS0='
WHERE
key_id = '2aeed45a74b5ffd06a8eea3148745241fe6c1f0fe507540e8ceee95fbc9cfd38'
AND (
token = 'IL7Z3sIF+IGm/Tgzd1CmZ6SdQGlmWnD4aFZ7XpTySS0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)