UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HLVCa5cr1Uqi90qAtzGPX0mHpGO3Ljwr1EDPGyE/75E='
WHERE
key_id = '21605c6450ded46002daf1fb317ec97c4ae669b206b2c9510411301bb9ca2dd9'
AND (
token = 'HLVCa5cr1Uqi90qAtzGPX0mHpGO3Ljwr1EDPGyE/75E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)