UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tlxUWoG6wQKFdCptmTK5XfOSoeD4wbJx+FUIp99QD54='
WHERE
key_id = '5548506a6382a118311b0bb1f96b1e00b69e6f865457aa2906d46b99d98bacc0'
AND (
token = 'tlxUWoG6wQKFdCptmTK5XfOSoeD4wbJx+FUIp99QD54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)