UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3MgccAxLAQefSFtdQpOLmtZhs/fD2QTAqAzeFuvHpfA='
WHERE
key_id = 'dfe17be2e4dae09f393df93e6df2709e41bb92db5cac3da556da318d8a52ee7f'
AND (
token = '3MgccAxLAQefSFtdQpOLmtZhs/fD2QTAqAzeFuvHpfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)