UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QOclJGVMHNkTXC7cBaB2/YPqRf/9MleKXcxmUXBEXJ8='
WHERE
key_id = '2576976d1411993ec7f674a56c353160979bac51f64b461f62c7ea389f0e8d3f'
AND (
token = 'QOclJGVMHNkTXC7cBaB2/YPqRf/9MleKXcxmUXBEXJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)