UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BnlLbbNyrujZ0YhJLrzYpwacyLTiGMXRmbz4qpxqqTI='
WHERE
key_id = '7ddfee5441c651f9bd91fcbffc836cc975a83092893c68eda2f78f49404bc81e'
AND (
token = 'BnlLbbNyrujZ0YhJLrzYpwacyLTiGMXRmbz4qpxqqTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)