UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZK5+rsyYWDS0+DENfc1IdzIeDWd4lvrtXxJCYvjdE8E='
WHERE
key_id = 'b41dbe3f5df3f2395d89ca84192ecdbf69c93b9b51ad8d254dd3e036201b9c6b'
AND (
token = 'ZK5+rsyYWDS0+DENfc1IdzIeDWd4lvrtXxJCYvjdE8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)