UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RhRx1/+HAmL8WE4u0PEcLW4NJHw43D/kUnbW+cqGkVo='
WHERE
key_id = '003258a8f7d58221dd6a49483c0a6d5f8599939542951db98ce301f6738f6b3f'
AND (
token = 'RhRx1/+HAmL8WE4u0PEcLW4NJHw43D/kUnbW+cqGkVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)