UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UWlWaBkC6eFGypJyCu74/2iO6ppW3oblptLF2j5b0wo='
WHERE
key_id = '9cbb442695406a75bb25138e9abab3d1bfb1f4640d910e202b0d5bb8e11e36b7'
AND (
token = 'UWlWaBkC6eFGypJyCu74/2iO6ppW3oblptLF2j5b0wo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)