UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1fdBDrN6rHu53jFm/bEZUdk7wnI5uQKokAeJC/xsC2M='
WHERE
key_id = 'ac85b4d537b81e28b98239c7bb5e49ab0534d3be530b5371454fe9c3b778410c'
AND (
token = '1fdBDrN6rHu53jFm/bEZUdk7wnI5uQKokAeJC/xsC2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)