UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Vlo1jNg48yxla/d37O6Dmf/GNxpBoUk/9NYWHjbQCg='
WHERE
key_id = 'a0152c08c187f1938375e4a61442105a13abc525faabdced5e43de4227ac9540'
AND (
token = '0Vlo1jNg48yxla/d37O6Dmf/GNxpBoUk/9NYWHjbQCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)