UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+I1t5Kar2+FYYCkAfKtNi4b8EgjY1ImFzHuFe6e99Yc='
WHERE
key_id = '9292d1dcd9303ac01da1aa52f7b207626e6455cce0a40d64769c0e6bc7880faa'
AND (
token = '+I1t5Kar2+FYYCkAfKtNi4b8EgjY1ImFzHuFe6e99Yc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)