UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PNE131hn5p77oUtNbU37V97X3QrPPol5LFEuXAHKjwQ='
WHERE
key_id = '289043ff77620302be965d72b38ee2e847ad6492e0819bdea5bb863f633c44d6'
AND (
token = 'PNE131hn5p77oUtNbU37V97X3QrPPol5LFEuXAHKjwQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)