UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I2/yuF1DwTBfRAXjyniUPQ192MpSuBeCf5QRPJXzuSE='
WHERE
key_id = '4aa28d3c27735a26bea6f1e77c6e14bfa00d9e8d88484673df37977d5fdd14b7'
AND (
token = 'I2/yuF1DwTBfRAXjyniUPQ192MpSuBeCf5QRPJXzuSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)