UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZPYQqHdcXu6fbZp5OZ2RpbvYsyT0Tvz8xdEeZl4iPE='
WHERE
key_id = '1e197e5983cf85f29f862733a15b63e5a30f691a002a008f3c36f0fa7cd3209f'
AND (
token = '8ZPYQqHdcXu6fbZp5OZ2RpbvYsyT0Tvz8xdEeZl4iPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)