UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hnrFd8h3EaKw/bvQ2ySv2vMM/pmh0rWNsHNMOEJEuj0='
WHERE
key_id = '3e3eb771315c03c500b672e6f965b6be6e934496b2e2865278d32c3cf493bf7f'
AND (
token = 'hnrFd8h3EaKw/bvQ2ySv2vMM/pmh0rWNsHNMOEJEuj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)