UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Zku/E/afTwPlRiTeIXPtKX4lDMnfT2qO9hN2CQCoRs='
WHERE
key_id = 'f82f8948c5d6e79f76369b22dc798a092cddf5bdfe105bda2632fe544a55b120'
AND (
token = '7Zku/E/afTwPlRiTeIXPtKX4lDMnfT2qO9hN2CQCoRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)