UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dzUDv21FH8gU9wx1lfWqSq2/liAoYxSxhSjE0Y8ojfY='
WHERE
key_id = '76496ac8275a8d88bda586492797e5a5ce4a827b31e1e1b4aae30cbdc91a33f7'
AND (
token = 'dzUDv21FH8gU9wx1lfWqSq2/liAoYxSxhSjE0Y8ojfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)