UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'biyDCGC6GyV+MZNFfnux6jv2SPGUhKKVeuXroGwv/Hw='
WHERE
key_id = 'c01655ea60a513732dca8226dafa238c64ada2c091b63f27d96c62ece3a3e0d6'
AND (
token = 'biyDCGC6GyV+MZNFfnux6jv2SPGUhKKVeuXroGwv/Hw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)