UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '217kxsxb0W+f0mUe/Mg2G7SolzdtirPFdWDnQ8wSPuo='
WHERE
key_id = '713ed66086d24f2f849c8b055e4de7b7e73350d1e036c13fd7521b98ddd56fe9'
AND (
token = '217kxsxb0W+f0mUe/Mg2G7SolzdtirPFdWDnQ8wSPuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)