UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bp/+xhjRj5lPQkbGvr4vUEvy5I9WnMUrzmJ8GoeKsFw='
WHERE
key_id = '96e4965466d1532f3f7b011ed0ee5216759e1119214c174d7b5f17b7077e1cd5'
AND (
token = 'bp/+xhjRj5lPQkbGvr4vUEvy5I9WnMUrzmJ8GoeKsFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)