UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's1W1s8jZAhFCOma+89Ju8vjb+3P2dsp4Jurh0tLK6bg='
WHERE
key_id = '0d5c38e5259642f5b7dcd49e137dab972152b4dff5f54cf7bbe1c3d9a970bb22'
AND (
token = 's1W1s8jZAhFCOma+89Ju8vjb+3P2dsp4Jurh0tLK6bg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)