UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wK6sbbU1WANtiejyDLcQP86q/BJEx2RlCRVDSVTKqzM='
WHERE
key_id = '32f5d08b09632861c8c4639c2a711519cdec0854454c122e79ccf6e3c66548b8'
AND (
token = 'wK6sbbU1WANtiejyDLcQP86q/BJEx2RlCRVDSVTKqzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)