UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PfKKgvxZQRAccTnwgio9PLZKLeIxeMYr7SS+d8bzw3c='
WHERE
key_id = '2f5cfa33405371845941b1df1da58b0df57deed058781b0ba677bc9a0ad2bf61'
AND (
token = 'PfKKgvxZQRAccTnwgio9PLZKLeIxeMYr7SS+d8bzw3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)