UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GtnLT32ehQPaZGx0D8BvZ7KF4F1Sv27/dxHza1VLgTo='
WHERE
key_id = 'be3fd3fd7b8c9cf784262899d899be78009b79652bdd4129f72601c1323fdbd1'
AND (
token = 'GtnLT32ehQPaZGx0D8BvZ7KF4F1Sv27/dxHza1VLgTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)