UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DNNUAc/3pMQbz4ADEyLKSErb4l2IX2Kmaz5ML7yDqb0='
WHERE
key_id = 'd019ea07da9757ea3579e6748d94d61a0fe7c70003de011042376b1f1b2d1a3a'
AND (
token = 'DNNUAc/3pMQbz4ADEyLKSErb4l2IX2Kmaz5ML7yDqb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)