UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7j6qqJs4JdQFt2BH+XoRPuNXuJDb7WLUdDjkyYTzgMw='
WHERE
key_id = '43f2270deb5ff1bba473e0d0541b7d8b02d2566741bff713a82d790d9e8fa5df'
AND (
token = '7j6qqJs4JdQFt2BH+XoRPuNXuJDb7WLUdDjkyYTzgMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)