UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1b5gO09YzfcjOfRDZfSoxCmDKFku8ZXCF754Ri6ppSk='
WHERE
key_id = 'a259de5b30a21d2170cb7d91c789a71a470140a086bf04aa66a03b2193fc4f50'
AND (
token = '1b5gO09YzfcjOfRDZfSoxCmDKFku8ZXCF754Ri6ppSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)