UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M6usLAhJlTtGjcTiTJrVJnV9AqpIxS41R8c/sq8NI3U='
WHERE
key_id = 'd3c9d04ffc083faf79ca0101c1cd84fb47c368563ea1da56c4560ea5ff06b42c'
AND (
token = 'M6usLAhJlTtGjcTiTJrVJnV9AqpIxS41R8c/sq8NI3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)