UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h/f7ubTW2E8lOePv/7oDqRAf5616MlVMGeA3g70bFac=' 
WHERE 
  key_id = '01a9778515b749ff456445b19ab036e7729c77946c0cda3aa20ef4c75825e98b' 
  AND (
    token = 'h/f7ubTW2E8lOePv/7oDqRAf5616MlVMGeA3g70bFac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036