UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3S8oBi/OydNp88JK/HlcNW7hQZPB/0TpWBHVNjR4K44='
WHERE
key_id = '7e3ba572b3e333cbe071d9f79531472958ce42db2fc00ca61c28172583f45bf5'
AND (
token = '3S8oBi/OydNp88JK/HlcNW7hQZPB/0TpWBHVNjR4K44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)