UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EiXGfPfcjteQmvgN9YnzbLAsioYigBPZNL7peZlWAd0='
WHERE
key_id = '64c918bd0a6fbd49f99eac0f35599ca65f8e6ed477ebe2eaa6d5a7f2270f09e6'
AND (
token = 'EiXGfPfcjteQmvgN9YnzbLAsioYigBPZNL7peZlWAd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)